<div class="col-md-9">
	<div class="span12">
		<div class="outer-border nav-page-sidebar-p10">
			<?php
				$email = security($_POST['email']);
				$cek = $koneksi->query("select id_member from member where email = '$email'");
				$ketemu = $cek->rowCount();
				if($ketemu > 0){
					?>
					<script type="text/javascript">
						alert("Mohon maaf Email anda sudah terdaftar");
					</script>
					<?php
					echo "<meta http-equiv='refresh' content='0; url=home.aspx'>";
				}else{
					$ses = session_id();
					$nama = security($_POST['nama']);
					$alamat = security($_POST['alamat']);
					$kabupaten = $_POST['kabupaten'];
					$kode_pos = security($_POST['kd_pos']);
					$tgl_lahir = "$_POST[thn]-$_POST[bln]-$_POST[tgl]";
					$telp = security($_POST['telp']);
					$pass = md5(security($_POST['password']));

					$tgl = date("my");

					$query = $koneksi->query("SELECT max(id_member) as maxID FROM member where id_member like 'BOS$tgl%'");
					$data = $query->fetch(PDO::FETCH_ASSOC);

					$idMax = $data['maxID'];
					$noUrut = (int) substr($idMax, 8, 4);
					$noUrut++;
					$id_member = "BOS$tgl".sprintf("%04s", $noUrut);
					
					$session = "$id_member$ses";
					
					$sttmt = $koneksi->exec("insert into member(id_member, pass, nama_lengkap, alamat, id_kabupaten, kd_pos, tgl_lahir, email, no_telp, aktivasi, id_session) values ('$id_member', '$pass', '$nama', '$alamat', $kabupaten, '$kode_pos', '$tgl_lahir', '$email', '$telp', 'Y', '$session')");

					$url_sukses="home.aspx";
					if($sttmt){
						session_register("id_member");
						session_register("nama");
						session_register("id_session");
						
						//isi dari variabel session
						$_SESSION['id_member'] = "$id_member";
						$_SESSION['nama'] = "$nama";
						$_SESSION['id_session'] = "$session";

						echo "<meta http-equiv='refresh' content='0; url=$url_sukses'>";
					}else{
						echo mysql_error();
					}
				}
			?>
		</div>
	</div>
</div>